﻿@model DataHelper.New
@{
    Lang lang = ViewBag.Lang;
    DataHelper.Comment comment = ViewBag.Comment;
    DataHelper.SEO seo = ViewBag.SEO;
    DataHelper.New[] OlderNews = ViewBag.OrderNews;
    DataHelper.Comment[] ListComment = ViewBag.ListComment;
    Layout = "~/Views/Shared/_Layout_About.cshtml";
    ViewBag.PageTitle = @Model.Title;
}
<style>
    .sub-title {
display: block;
background-color: #D61321;
color: white;
padding: 5px;
margin: 10px 0px 10px 0px;
}
    .input.t-input {
        width: 95%;
    }

    .c-label {
        width: 100px;
        display: block;
        float: left;
    }

    #post-comment table tr td:first-child {
        width: 100px;
    }
</style>
<div id="d-news" class="left">

    <div class="updateddate" style="font-style: italic; float: right; font-size: 11px">@lang.LASTUPDATED
        : @Model.UpdatedDate.Value.ToString("dd/MM/yy - HH:mm")
    </div>
    <div id="d-body" class="clear">
        @Html.Raw(Model.Content)
    </div>
    <div id="d-foot" class="clear">
        <div style="float: right">
            <a href="javascript: history.go(-1)" style="color: Black;">[ @lang.RETURN ]</a>
        </div>
        <br />
    </div>
    <div id="comments" class="clear" style="margin: 10px;">
        <div >
            <h2 class="sub-title">
                @lang.COMMENT
            </h2>
        </div>
        <br />
        <ul class="sayingContent">
            @{
                Random r = new Random();
                foreach (var c in ListComment)
                {
                    int iRandom = r.Next(1, 10);
                <li class="note">
                    <img src="@(seo.Domain + "/Content/Images/avarta/av" + iRandom + ".png")" alt="@c.Name" />
                    <div class="text">
                        <p class="">
                            "@Html.Raw(c.Comment1)"
                        </p>
                        <span class="datepost">@lang.SENTAT : @c.CreatedDate.ToString("dd/MM/yyy HH:mm")
                        </span>
                        <br>
                        <span class="nameKH">@c.Name </span><span style="float: right;">
                            <br>
                        </span>
                    </div>
                    <div class="clear">
                    </div>
                </li>
                }
            }
        </ul>
    </div>
    <a href="#comments" style="color: White">link</a>
    <div id="post-comment" class="clear" style="margin: 10px;">
        <div >
            <h2 class="sub-title">
                @lang.YOURCOMMENT
            </h2>
        </div>
        <br />
        <form  method="post" action="@seo.Domain/News/Detail/@MDF.Utilites.Helper.StringHelper.ToNonUnicodeAndLower(Model.Title).Replace(" ", "-")-@Model.ID#comments " >
            @Html.Hidden("comment.NewsID", comment.NewsID, new { @class = "input t-input" })
            <table style="width: 100%">
                <tr>
                    <td>
                        <label class="c-label">@lang.NAME</label></td>
                    <td>
                        <div class="row">
                            @Html.TextBox("comment.Name", comment.Name, new { @class = "input t-input", required = "required" ,@style="width: 95%" })
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="c-label">@lang.EMAIL</label></td>
                    <td>
                        <div class="row">
                            @Html.TextBox("comment.Email", comment.Email, new { @class = "input t-input", required = "required", type = "email",@style="width: 95%" })
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="c-label">@lang.PHONE</label></td>
                    <td>
                        <div class="row">
                            @Html.TextBox("comment.Phone", comment.Phone, new { @class = "input t-input", type = "number" ,@style="width: 95%"})
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="c-label">@lang.COMMENT</label>
                    </td>
                    <td>
                        <div class="row">
                            @Html.TextArea("comment.Comment1", comment.Comment1, new { @class = "input t-input valid-email", required = "required" })
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <button type="submit" class="t-button t-state-default btn-index btn-8 btn-8c">
                            @lang.COMMENT</button></td>
                </tr>
            </table>

        </form>
    </div>
</div>

<script>
    $("#post-comment").validate();
</script>
